package com.tianda.rbac_demo.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.tianda.rbac_demo.domain.BaseResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GoodsController {
    /**
     *  @SaCheckPermission("/goods/list")
     *  sa-token的权限校验注解
     *   value : 当前资源的权限集合码
     */
    @SaCheckPermission("/goods/list")
    @RequestMapping("/goods/list")
    public BaseResult index(){
        return BaseResult.success("商品列表");
    }

    @SaCheckPermission("/goods/add")
    @RequestMapping("/goods/add")
    public BaseResult add(){
        return BaseResult.success("添加成功");
    }
}
